﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using MvcAppFinal1.Models.OMS.Infrastracture.Repositories;
using MvcAppFinal1.Models.OMS.Domain.Model;

namespace MvcAppFinal1.Models
{
    public class UserInitializer : DropCreateDatabaseIfModelChanges<UserRepository>
    {
        protected override void Seed(UserRepository context)
        {
            var Users = new List<User> 
            {
                new User { UserId = 1, LoginName = "LoginName1"},
                new User { UserId = 2, LoginName = "LoginName2"}
            };
            Users.ForEach(user => context.Users.Add(user));
            context.SaveChanges();
        }
    }
}